// Copyright (c) 2020 Presto Labs Pte. Ltd.
// Author: jingyuan

#include <gflags/gflags.h>

#include "cc/experimental/jingyuan/basis_exchange_strategy.h"

DEFINE_string(driver, "", "driver config");
DEFINE_string(config, "", "strategy config");

int main(int argc, char* argv[]) {
  google::InitGoogleLogging(argv[0]);
  gflags::ParseCommandLineFlags(&argc, &argv, true);

  auto path = std::experimental::filesystem::path(FLAGS_driver);
  coin2::app::DriverConfig app_config;
  app_config.MergeFrom(coin2::base::config::DriverConfigFromJson(path));
  LOG(INFO) << "app_config: " << app_config.DebugString();

  coin2::strategy::basis_strategy::BasisStrategy strategy(FLAGS_config, GetCurrentTimestamp());
  coin2::app::Driver driver(app_config, &strategy);
  driver.RegisterCleanupHandler();
  driver.Run();
  return 0;
}
